<!doctype html>
<html lang="en">
 <head>
  <meta charset="UTF-8">
  <meta name="Generator" content="EditPlus®">
  <meta name="Author" content="">
  <meta name="Keywords" content="">
  <meta name="Description" content="">
  <title>map()、reduce()</title>
  <script type="text/javascript">
  <!--
	window.alert=function(s){console.log(s);};
	var arr = [1, 2, 3, 4, 5];
	function f1(x){
		return x*x+1;
	}
	alert(arr.map(f1));
	
	function f2(a,b) {
		return b-a;
	}
	alert(arr.map(f1).reduce(f2));
  //-->
  </script>
 </head>
 <body>
  
 </body>
</html>
